/*************************************************************************
> File Name: cite_02.cpp
> Author: hzy
> Created Time: 2023-08-08 11:05:12
> Description:  函数返回值是引用类型变量
************************************************************************/
#include <iostream>

using namespace std;

int &getNum(void)
{
    static int num = 123;  //需要加static修饰变量，不然getNum函数结束num的空间就被释放
    cout << "num = " << num << endl;

    return num;
}

int main()
{
    int &Num = getNum();
    cout << "NUM = " << Num << endl;

    return 0;
}